import time

from appium.webdriver.webdriver import WebDriver
from app.wework.model.base_page import BasePage
from appium.webdriver.common.touch_action import TouchAction
from appium.webdriver.common.appiumby import AppiumBy


class EditContactPage(BasePage):
    """编辑用户页面"""
    def __init__(self, driver: WebDriver):
        super().__init__(driver)

    def edit_info(self):
        ...

    def delete_member(self):
        time.sleep(2)
        actions = TouchAction(self.driver)
        # 向上滑动屏幕
        actions.press(x=550, y=1900).wait(1000).move_to(x=550, y=1200).wait(1000).release()
        actions.perform()
        self.find(AppiumBy.ID, 'gih').click()
        # 点击取消按钮
        # self.find(AppiumBy.ID, 'ch5').click()
        # 点击确定按钮
        self.find(AppiumBy.ID, 'ch8').click()


